package com.atguigu.common.to.es;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * "mappings":{
 * "properties": {
 * "skuId":{ "type": "long" },
 * "spuId":{ "type": "keyword" },
 * "skuTitle": {
 * "type": "text",
 * "analyzer": "ik_smart"
 * },
 * "skuPrice": { "type": "keyword" },
 * "skuImg"  : { "type": "keyword" },
 * "saleCount":{ "type":"long" },
 * "hasStock": { "type": "boolean" },
 * "hotScore": { "type": "long"  },
 * "brandId":  { "type": "long" },
 * "catalogId": { "type": "long"  },
 * "brandName": {"type": "keyword"},
 * "brandImg":{
 * "type": "keyword",
 * "index": false,
 * "doc_values": false
 * },
 * "catalogName": {"type": "keyword" },
 * "attrs": {
 * "type": "nested",
 * "properties": {
 * "attrId": {"type": "long"  },
 * "attrName": {
 * "type": "keyword",
 * "index": false,
 * "doc_values": false
 * },
 * "attrValue": {"type": "keyword" }
 * }
 * }
 * }
 */
@Data
public class SkuEsModel {
    //"skuId":{ "type": "long" },
    private Long skuId;
    //"spuId":{ "type": "keyword" },
    private Long spuId;
    private String skuTitle;//全文检索
    private BigDecimal skuPrice;
    private String skuImg;

    private Long saleCount;//销量
    private Boolean hasStock;//是否有库存
    private Long hotScore;//热度评分
    private Long brandId;//品牌ID
    private Long catalogId;//分类ID
    private String brandName;//品牌名 不在数据库检索
    private String brandImg;
    private String catalogName;
    //商品规格属性Attrs

    private List<Attrs> attrs;
    @Data
    public static class Attrs{
        private Long attrId;
        private String attrName;
        private String attrValue;
    }
}
